// 入口文件
import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import router from './router.js'

import VueResource from 'vue-resource'

import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

import 'element-ui/lib/theme-chalk/index.css'


import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI)

import Vuex from 'vuex'
Vue.use(Vuex)
var store = new Vuex.Store({
    state: {
        count: 2
    },
    mutations: {
        add(state,num) {
            state.count=num
        }
    }
})



// import {
//     Header, Swipe, SwipeItem, Field, Button,Lazyload
// } from 'mint-ui'

// Vue.component(Header.name, Header);
// Vue.component(Swipe.name, Swipe);
// Vue.component(SwipeItem.name, SwipeItem);
// Vue.component(Field.name, Field);
// Vue.component(Button.name, Button);
// Vue.use(Lazyload);

import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
Vue.use(MintUI)

import moment from 'moment'


import VuePreview from 'vue-preview'

// defalut install
Vue.use(VuePreview)


Vue.use(VueRouter)
Vue.use(VueResource)

Vue.http.options.emulateJSON = true;

Vue.filter("dateFormat", (date, pattern = pattern || 'YYYY-MM-DD HH:mm:ss') => {

    return moment(date).format(pattern);
})
new Vue({
    el: '#app',
    render: c => c(App),
    router,
    store
})